package ClassWork.Work_03.Students;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        List<Students> students = new ArrayList<>();
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 5; i++) {
            System.out.println("Enter student name: ");
            String name = sc.next();
            System.out.println("Enter student age: ");
            String age = sc.next();
            Students stu = new Students();
            stu.setId(i + 1);
            stu.setSname(name);
            stu.setSage(age);
            students.add(stu);
        }
        for(int i = 0; i < students.size(); i++) {
            System.out.println(students.get(i));
        }
    }
}
